package com.zlz.server.controller;


import com.zlz.server.pojo.Menu;
import com.zlz.server.pojo.RespBean;
import com.zlz.server.service.IAdminService;
import com.zlz.server.service.IMenuService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author efire
 * @since 2021-01-17
 */
@RestController
@RequestMapping("/system/cfg")
public class MenuController {
    @Resource
    private IMenuService iMenuService;

    @ApiOperation(value = "通过用户id查询菜单列表")
    @GetMapping("/menu")
    public RespBean getMenusByAdmiId() {
        List<Menu> menus = iMenuService.getMenusByAdminId();
        return RespBean.success(menus);
    }
}
